cc.Class({
    extends: cc.Component,
    properties: {
    },
    onLoad: function () {
        this.node.on('mousedown', this.startPlay, this);
        this.node.on('touchstart', this.startPlay, this);
    },
    startPlay: function () {
        if (Global.isJoin == true) return;
        //通知服务端游戏开始 顺便生成一个星星 设定游戏倒计时
        var sendData = {
            type: "gameStart",
            jumpHeight: Global.playerSelf.jumpHeight,
            groundY: Global.game.groundY,
            starDistance: Global.game.starDistance
        }
        var sendString = JSON.stringify(sendData);
        Global.ws.send(sendString);
    },
    exitRoom: function () {
        Global.close();
    }

})


